#include <iostream>
#include <atomic>
#include <thread>
#include <mutex>
std::atomic<int> count = 0;
std::mutex m;
void add()
{

    for (int idx = 0; idx < 10000; idx++)
    {
        // std::lock_guard<std::mutex> lock(m);
        count++;
    }
}
int main()
{
    auto begin = std::chrono::system_clock::now();
    std::thread t1(add);
    std::thread t2(add);
    t1.join();
    t2.join();
    auto end = std::chrono::system_clock::now();
    auto time = std::chrono::duration<double>(end - begin);
    std::cout << time.count() * 1000 << std::endl;
    std::cout
        << count << std::endl;
    return 0;
}